package cn.com.yusys.yusp.admin.web.rest;

import cn.com.yusys.yusp.admin.service.LeaderShipCockpitService;
import cn.com.yusys.yusp.commons.mapper.QueryModel;
import cn.com.yusys.yusp.commons.web.rest.dto.ResultDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author zoie
 */
@RestController
@RequestMapping("/api/leaderShipCockpit")
@Api(tags = "leaderShipCockpit")
public class LeaderShipCockpitResource {
    @Autowired
    private LeaderShipCockpitService leaderShipCockpitService;

    private final Logger log = LoggerFactory.getLogger(LeaderShipCockpitResource.class);

    /**
     * @方法名称: queryAddCustRank
     * @方法描述: 网格每周新增客户数排名
     * @参数与返回说明:
     * @算法描述:
     */
    @GetMapping("/queryAddCustRank")
    @ApiOperation(value = "网格每周新增客户数排名", notes = "网格每周新增客户数排名")
    public ResultDto<List<Map<String, Object>>> queryAddCustRank(QueryModel queryModel) {
        List<Map<String, Object>> list = leaderShipCockpitService.queryAddCustRank(queryModel);
        return new ResultDto<>(list);
    }

    /**
     * 当前重点考核指标排名
     * @param queryModel
     * 指标类型：01存款02经营贷03苏农贷04社保卡激活
     * @return
     */
    @GetMapping("/queryImportIndexRank")
    @ApiOperation(value = "当前重点考核指标排名", notes = "当前重点考核指标排名")
    public ResultDto<List<Map<String, Object>>> queryImportIndexRank(QueryModel queryModel) {
        List<Map<String, Object>> list = leaderShipCockpitService.queryImportIndexRank(queryModel);
        return new ResultDto<>(list);
    }

    /**
     * 网格客户模拟利润提升
     * @return
     */
    @GetMapping("/querySimuProfitRank")
    @ApiOperation(value = "网格客户模拟利润提升", notes = "网格客户模拟利润提升")
    public ResultDto<List<Map<String, Object>>> querySimuProfitRank() {
        List<Map<String, Object>> list = leaderShipCockpitService.querySimuProfitRank();
        return new ResultDto<>(list);
    }

    /**
     * 全行网格概览
     * @return
     */
    @GetMapping("/queryGridOverviewInfo")
    @ApiOperation(value = "全行网格概览", notes = "全行网格概览")
    public ResultDto<List<Map<String, Object>>> queryGridOverviewInfo() {
        List<Map<String, Object>> list = leaderShipCockpitService.queryGridOverviewInfo();
        return new ResultDto<>(list);
    }

    /**
     * 网格黏性排名
     * @param queryModel
     * @return
     */
    @GetMapping("/queryGridViscosityRank")
    @ApiOperation(value = "网格黏性排名", notes = "网格黏性排名")
    public ResultDto<List<Map<String, Object>>> queryGridViscosityRank(QueryModel queryModel) {
        List<Map<String, Object>> list = leaderShipCockpitService.queryGridViscosityRank(queryModel);
        return new ResultDto<>(list);
    }

    /**
     * 网格走访排名
     * @return
     */
    @GetMapping("/queryGridVisitRank")
    @ApiOperation(value = "网格走访排名", notes = "网格走访排名")
    public ResultDto<List<Map<String, Object>>> queryGridVisitRank() {
        List<Map<String, Object>> list = leaderShipCockpitService.queryGridVisitRank();
        return new ResultDto<>(list);
    }

}



